package com.huilian.iotbox.admin.wap.controller;

import com.huilian.iotbox.admin.wap.service.ExternalDeviceParamValueService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.dto.ExternalDeviceParamValueDto;
import com.huilian.iotbox.data.vo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

/**
 * @author chenqiwen
 * @CreateDate: 2021-09-14-16-17
 * @Description:
 */
@RestController
@RequestMapping("/api/externalDeviceParamValue")
public class ExternalDeviceParamValueController extends UserInfoController {

    @Autowired
    private ExternalDeviceParamValueService externalDeviceParamValueService;

    @GetMapping("/sendQueryExternalDeviceParamValue")
    public ServerResponse sendQueryExternalDeviceParamValue(HttpServletRequest request, ExternalDeviceParamValueDto externalDeviceParamValueDto) {
        UserInfo userInfo = super.getLoginUserInfo(request);
        externalDeviceParamValueDto.setUserInfo(userInfo);
        return externalDeviceParamValueService.sendQueryExternalDeviceParamValue(externalDeviceParamValueDto);
    }
    @GetMapping("/sendQueryExternalVendingDeviceParamValue")
    public ServerResponse sendQueryExternalVendingDeviceParamValue(HttpServletRequest request, ExternalDeviceParamValueDto externalDeviceParamValueDto) {
        UserInfo userInfo = super.getLoginUserInfo(request);
        externalDeviceParamValueDto.setUserInfo(userInfo);
        return externalDeviceParamValueService.sendQueryExternalVendingDeviceParamValue(externalDeviceParamValueDto);
    }
}
